Skip to main content

What’s New

Qrvey 8.7
Version 8.7 of the Qrvey platform is now available to customers! This version includes new features including area charts, the ability to pivot and export data, as well as numerous bug fixes and performance improvements.
Learn More
Qrvey 8.6
Version 8.6 of the Qrvey platform is now available to customers. This version includes several new feature enhancements and performance improvements.
Learn More
Required Update for 8.5.1
Attention 8.5.1 customers: for any 8.5.1 instance deployed prior to 08/05/2024, an update is required to ensure you are running the latest images.
Learn More
Qrvey 8.5
Version 8.5 (LTS) of the Qrvey platform is now available to customers. This version includes several new features and performance improvements.
Learn More
End-of-life Schedule
We've added a new article that lists the features and endpoints that have been scheduled for deprecation. All features and endpoints will be supported for (1) year after the release date of the LTS version that contains the alternative.
Learn More
Version: 8.7

Working With Filters in Widgets

Qrvey provides filtering to refine data based on your needs. When embedding Qrvey Widgets into your system, you may need to combine Qrvey’s filters with your own set of filter controls. This article walks you through the steps needed to pass the values of your own filters to embedded Qrvey widgets. For an general introduction to filters, please see Working with Interactive Filters.

You can pass values to Qrvey’s widgets to filter charts or pages depending on your needs using the Filter Object Structure, as described below. The structure is passed as part of the supported widget’s configuration object as userFilters and it can contain an array of filters with the global scope by default.

The Filter Object

This feature is available with the Dashboard View, Dashboard Builder, Single Panel, and Analytic Suite widgets and you can find sample code in each of the mentioned articles.

var config = {
attribute1: value1,
attribute2: value2,
...,
"userFilters": { "filters": [...] }
}

Filters Object

PropertyTypeRequiredDescription
operatorStringNoDefault AND. Each filter requires a boolean logic to refine the data based on the user’s criteria. Allowed values:
AND
OR
expressionsArrayYesIt’s a list of filter criteria to refine the data. Each item in the collection includes one or multiple Expressions Objects.

Expressions Object

PropertyTypeRequiredDescription
qrveyidStringNoRepresent the dataset ID used to refine the data.
questionidStringNoRepresent the dataset’s column ID used to refine the data, should belong to the qrvey defined above.
questionTypeStringYesIt’s only required if the column used to refine the data is a FORMULA or a BUCKET; otherwise, it is optional. Allowed values:
FORMULA
BUCKET
validationTypeStringYesThe field represents the operand for filtering. Allowed values:
EQUAL
NOT_EQUAL
CONTAIN
NOT_CONTAIN
END_WITH
NOT_END_WITH
START_WITH
NOT_START_WITH
RANGE
IS_EMPTY
* IS_NOT_EMPTY
propertyStringNoWhen using complex data types like the ones defined inside Webforms, Quizzes, or Surveys, it’s required. Please refer to Complex Properties for a complete list of supported values.
groupValueStringNoDefault ‘day’. Only applies when you want to group date values. Allowed values:
year
month
quarter
week
day
hour
minute
second
valueArrayYesList of values used to filter the data. Qrvey will return all the records that match the criteria defined in the filter. Depending on the column’s data type, you may require additional parameters.

Strings
"value": [
"United States"
]

Number or Date*
**lt**: Less than.*
**lte**: Less than or equalto.*
**gt**: Greater than.*
**gte**: Greater than or equal to.

"value": [
{
"gt": "10507.231"
}
]


"value": [
{
"lte": "11/30/2016",
"gte": "05/15/2014"
{"}"}
]

Complex Properties

PropertyOutputWeb Form Column Type
first_nameStringNAME
last_nameStringNAME
full_nameStringNAME
first_name_lowerStringNAME
last_name_lowerStringNAME
full_name_lowerStringNAME
skipped_questionStringNAME, ADDRESS, USADDRESS, LONGTEXT, TEXTFIELD, FILEUPLOAD, IMAGEUPLOAD, DATE, NUMERIC, RATING, SLIDEBAR, YES_NO, DROPDOWN, SINGLE_CHOICE, MULTIPLE_CHOICE, EXPRESSION, CHECKLIST, PASSWORD, EMAIL_FORM, RANKING, SIGNATURE, PHONE, IMAGE, LOOKUP
full_addressStringADDRESS, USADDRESS
countryStringADDRESS, USADDRESS
state_codeStringADDRESS, USADDRESS
stateStringADDRESS, USADDRESS
countryStringADDRESS, USADDRESS
state_nameStringADDRESS, USADDRESS
cityStringADDRESS, USADDRESS
postal_codeStringADDRESS, USADDRESS
zipStringADDRESS, USADDRESS
address_line_1StringADDRESS, USADDRESS
address_line_2StringADDRESS, USADDRESS
full_address_lowerStringADDRESS, USADDRESS
state_code_lowerStringADDRESS, USADDRESS
state_lowerStringADDRESS, USADDRESS
state_name_lowerStringADDRESS, USADDRESS
city_lowerStringADDRESS, USADDRESS
postal_code_lowerStringADDRESS, USADDRESS
zip_lowerStringADDRESS, USADDRESS
address_line_1_lowerStringADDRESS, USADDRESS
street_address_lowerStringADDRESS, USADDRESS
address_line_2_lowerStringADDRESS, USADDRESS
wordsStringLONGTEXT o TEXTFIELD, DROPDOWN, LOOKUP
entitiesStringLONGTEXT o TEXTFIELD
entitiestypeStringLONGTEXT o TEXTFIELD
sentimentStringLONGTEXT o TEXTFIELD
keywordsStringLONGTEXT o TEXTFIELD
filesizeNumericFILEUPLOAD, IMAGEUPLOAD
filetypeStringFILEUPLOAD, IMAGEUPLOAD
filenameStringFILEUPLOAD
fileurlStringFILEUPLOAD, IMAGEUPLOAD
all_detailsStringFILEUPLOAD, IMAGEUPLOAD
analysisStringIMAGEUPLOAD
yearNumericDATE
monthNumericDATE
dayNumericDATE
quarterNumericDATE
weekNumericDATE
hourNumericDATE
minuteNumericDATE
secondNumericDATE
valueStringNUMERIC
lowerStringDROPDOWN, SINGLE_CHOICE, MULTIPLE_CHOICE, LOOKUP
expression_typeStringEXPRESSION
local_partStringEMAIL_FORM
domainStringEMAIL_FORM
rank{{x}}StringRANKING. (x) denotes the ranking position.
signature_urlStringSIGNATURE
area_codeStringPHONE
answer_idStringIMAGE
display_fullStringLOOKUP
display_allStringLOOKUP
display_{{x}}StringLOOKUP. Show display with index (x)

Example: A Simple Filter

The following example shows the filter structure for a simple range filter on a numeric column:

Sample Filter: COLUMN_ID BETWEEN 10 AND 15.

...
"userFilters": {
"filters": [
{
"operator": "AND",
"expressions": [
{
"qrveyid": "QRVEY_ID",
"questionid": "COLUMN_ID",
"validationType": "RANGE",
"value": [
{
"lte": 15,
"gte": 10
}
]
}
]
}
]
}

Example: Filter Multiple Columns

The following example shows the filter structure for three filters with different columns and conditions.

Sample Filter:
COLUMN_ID_1 BETWEEN 05/15/2014
AND
11/30/2016
AND
COLUMN_ID_2 EQUAL ‘United States’ AND COLUMN_ID_3 GREATHER_THAN 10507.231

...
"userFilters": {
"filters": [
{
"operator": "AND",
"expressions": [
{
"qrveyid": "QRVEY_ID",
"groupValue": "day",
"questionid": "COLUMN_ID_1",
"validationType": "RANGE",
"value": [
{
"lte": "11/30/2016",
"gte": "05/15/2014"
}
]
},
{
"qrveyid": "QRVEY_ID",
"questionid": "COLUMN_ID_2",
"validationType": "EQUAL",
"value": ["United States"]
},
{
"qrveyid": "QRVEY_ID",
"questionid": "COLUMN_ID_3",
"validationType": "RANGE",
"value": [
{
"gt": "10507.231"
}
]
}
]
}
]
}